class CreateUserRoles < ActiveRecord::Migration
  def self.up
    create_table :user_roles do |t|
      t.references :user
      t.references :role

      t.timestamps
    end
    add_index :user_roles, [:user_id, :role_id], :unique => true
  end

  def self.down
    remove_index :user_roles, :column => [:user_id, :role_id]
    drop_table :user_roles
  end
end
